// 文件上传
export function uploadFile(file: string): Promise<string> {
  return new Promise((resolve, reject) => {
    const URL: string = import.meta.env.VITE_GLOB_DOMAIN_URL
    let a = uni.uploadFile({
      url: URL + '/sys/common/upload',
      filePath: file,
      name: 'file',
      success: (res) => {
        let data = JSON.parse(res.data)
        if (data.success) {
          resolve(data.message)
        }
      },
    })
  })
}
